﻿using ConfExpert.Forms.Base;
using DevTeam;

using System;
namespace ConfExpert.Forms.SatinAlma.YeniYapi.Confirmation
{
    public partial class MevcutKonf : XForm
    {
        int UreticiId = 0;
        public MevcutKonf(int UreticiId)
        {
            InitializeComponent();
            this.UreticiId = UreticiId;
        }

        private void MevcutKonf_Load(object sender, EventArgs e)
        {
            gridView1.Init("GetMevcutKonf", UreticiId);
            gridView1.MakeReadOnly();
            gridView1.BestFitColumns();
            gridView1.DoubleClick += gridView1_DoubleClick;
        }

        public string KonfirmasyonNo;
        public int TeslimSekliId, ShipMethodId, CurrencyId, PaymentMethodId, PaymentTermId, OngYuklemeSekliId, CarrierId;
        public DateTime ShipDate, KonfirmasyonTarihi;
        void gridView1_DoubleClick(object sender, EventArgs e)
        {
            KonfirmasyonNo = gridView1.GetFocusedDataRow()["KonfirmasyonNo"].ToStr();
            KonfirmasyonTarihi = gridView1.GetFocusedDataRow()["KonfirmasyonTarihi"].ToDate();
            TeslimSekliId = gridView1.GetFocusedDataRow()["TeslimSekliId"].ToInt();
            ShipMethodId = gridView1.GetFocusedDataRow()["ShipMethodId"].ToInt();
            CurrencyId = gridView1.GetFocusedDataRow()["CurrencyId"].ToInt();
            PaymentMethodId = gridView1.GetFocusedDataRow()["PaymentMethodId"].ToInt();
            PaymentTermId = gridView1.GetFocusedDataRow()["PaymentTermId"].ToInt();
            OngYuklemeSekliId = gridView1.GetFocusedDataRow()["ShipMethodId"].ToInt();
            //OngYuklemeTarihi = gridView1.GetFocusedDataRow()["ShipDate"].ToDate();
            CarrierId = gridView1.GetFocusedDataRow()["CarrierId"].ToInt();

            this.DialogResult = System.Windows.Forms.DialogResult.OK;

        }
    }
}
